import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysMenuTop = (params) => {
  params.head.transCode = 'querySysMenuTop';
  return request({
    url: '/platform/sysMenuTop/querySysMenuTop',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysMenuTopListPage = (params) => {
  params.head.transCode = 'querySysMenuTopListPage';
  return request({
    url: '/platform/sysMenuTop/querySysMenuTopListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysMenuTop = (params) => {
  params.head.transCode = 'saveSysMenuTop';
  return request({
    url: '/platform/sysMenuTop/saveSysMenuTop',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysMenuTopList = (params) => {
  params.head.transCode = 'saveSysMenuTopList';
  return request({
    url: '/platform/sysMenuTop/saveSysMenuTopList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysMenuTop = (params) => {
  params.head.transCode = 'saveOrUpdateSysMenuTop';
  return request({
    url: '/platform/sysMenuTop/saveOrUpdateSysMenuTop',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysMenuTopList = (params) => {
  params.head.transCode = 'saveOrUpdateSysMenuTopList';
  return request({
    url: '/platform/sysMenuTop/saveOrUpdateSysMenuTopList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysMenuTop = (params) => {
  params.head.transCode = 'updateSysMenuTop';
  return request({
    url: '/platform/sysMenuTop/updateSysMenuTop',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysMenuTop = (params) => {
  params.head.transCode = 'deleteSysMenuTop';
  return request({
    url: '/platform/sysMenuTop/deleteSysMenuTop',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysMenuTopList = (params) => {
  params.head.transCode = 'deleteSysMenuTopList';
  return request({
    url: '/platform/sysMenuTop/deleteSysMenuTopList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysMenuTopExcel = (params) => {
  downloadExcel({
    url: '/platform/sysMenuTop/excelDownload/exportSysMenuTopExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
